<?php 
if (substr($_SERVER['REQUEST_URI'], 0,5) == '/cms/'){ 
    include 'index-cms.php';
}else{
    $action='index';
    $module='index';
    
    $cssPath='/cms';
    $cmsPath='./cms';
    
    if ('localhost' == $_SERVER['SERVER_NAME']){
        $cssPath='';
        $cmsPath='.';
    }

    $urlPath=explode('/', substr($_SERVER['REQUEST_URI'], 1));
    include_once($cmsPath."/app/config/config.php");
    if (isset($urlPath[0]) && isset($urlPath[1]) && !empty($urlPath[1])){
        $actionPath=$cmsPath.'/app/action/'.$urlPath[0].'.php';
        if (file_exists($actionPath)){
            include $actionPath;
        }
    }else{
        include $cmsPath.'/app/action/index.php';
    }
   
}